package com.stylefeng.guns.core.util.appSecure;

import java.io.File;

/**
 * Description: 文件或字符串hash值计算
 * @author
 * @version 2.0
 * @since 2016/1/6
 */
public class HashUtil {

    public static byte[] rawMd5(byte[] bytes) {
        return Hash.hash(bytes, Hash.MD5);
    }

    public static String md5(byte[] bytes) {
        return Hash.make(bytes, Hash.MD5);
    }

    public static String md5(File filepath) {
        return Hash.make(filepath, Hash.MD5);
    }

    public static String sha1(byte[] bytes) {
        return Hash.make(bytes, Hash.SHA1);
    }

    public static String sha1(File filepath) {
        return Hash.make(filepath, Hash.SHA1);
    }
}
